/*
2019.9.5
*/ 
#include<iostream>
#include<vector>

using std::cin;
using std::cout;
using std::endl;
using std::vector;
int largestPerimeter(vector<int>& A);
int main()
{
	vector<int> vec={3,4,5};
	int l=largestPerimeter(vec);
	cout<<l<<endl;
	return 0;
}
int largestPerimeter(vector<int>& A) 
{
	
    for(int i=A.size()-1;i>=2;i--)
	{
		int a=A[i],b=A[i-1],c=A[i-2];
		if(a+b>c)
		return a+b+c;
	} 
	return 1;   
}
